#ifndef _NTP_H_INCLUDED_
#define _NTP_H_INCLUDED_

typedef struct {
    uint8 li_vn_mode;
    uint8 stratum;
    uint8 poll;
    uint8 precision;
    uint32 root_delay;
    uint32 root_dispe;
    uint32 ref_id;
    uint32 ref_time_h;
    uint32 ref_time_l;
    uint32 orig_time_h;
    uint32 orig_time_l;
    uint32 recv_time_h;
    uint32 recv_time_l;
    uint32 tran_time_h;
    uint32 tran_time_l;
} ntp_packet;

typedef struct {
    uint16 hour;
    uint16 min;
    uint16 sec;
} ntp_time;

void ntp_query(const uint8 server[]);
ntp_time ntp_gettime(ntp_packet *np);

#endif
